<?php
/**
 * @author xp
 */
function ss($name, $server, $port, $method, $pass, $args = '') {
    $uri = $method . ':' . $pass . '@' . $server . ':' . $port;
    $uri = 'ss://' . base64_encode($uri) . '/';
    if (strlen($args)) $uri .= '?' . $args;
    if (strlen($name)) $uri .= '#' . $name;
    return $uri;
}

function vmess($name, $server, $port, $method, $uuid, $args = '') {
    $uri = $method . ':' . $uuid . '@' . $server . ':' . $port;
    $uri = 'vmess://' . base64_encode($uri) . '?';
    if (strlen($name)) $uri .= '&remarks=' . $name;
    // &obfs=none&tfo=1&mux=1
    if (strlen($args)) $uri .= $args;
    return $uri;
}
